<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QIap: DRMFile Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<h1>DRMFile Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="DRMFile" -->
<p>Utility API intended to demonstrate and facilitate access to DRM protected content.  
<a href="#_details">More...</a></p>

<p><a href="class_d_r_m_file-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a53dc1c86f77c9f37b8f7f2a1305fd682">DRMFile</a> (QObject *parent=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#a53dc1c86f77c9f37b8f7f2a1305fd682"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5651027bc490a63de2b09ec31c8eb7c4"></a><!-- doxytag: member="DRMFile::~DRMFile" ref="a5651027bc490a63de2b09ec31c8eb7c4" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a5651027bc490a63de2b09ec31c8eb7c4">~DRMFile</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a86497f25a0b6a500a4188bbfc56d566a">open</a> (const QString &amp;name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read only open method for the specified file.  <a href="#a86497f25a0b6a500a4188bbfc56d566a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a9787a72211feb206203384e835610e03">read</a> (uchar *&amp;data)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates memory buffer and reads the whole file content into that. Allocated buffer is returned to client via reference pointer 'data' parameter. Client is responcible for allocated memory release.  <a href="#a9787a72211feb206203384e835610e03"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace3b5972cf6e621c9e7b7ce9366037e1"></a><!-- doxytag: member="DRMFile::close" ref="ace3b5972cf6e621c9e7b7ce9366037e1" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#ace3b5972cf6e621c9e7b7ce9366037e1">close</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the file. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2cd5c61d03c886592c10935840c87a9e"></a><!-- doxytag: member="DRMFile::size" ref="a2cd5c61d03c886592c10935840c87a9e" args="()" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a2cd5c61d03c886592c10935840c87a9e">size</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a 32b value size of the amount of available (uncompressed) data. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#af1007998fe521bb33ce458f56aff0c27">isDRMError</a> (int error)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the error code returned by the *open* method is a DRM specific error.  <a href="#af1007998fe521bb33ce458f56aff0c27"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_d_r_m_file_private.html">DRMFilePrivate</a> *const&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_r_m_file.html#a4741a5b903d47f2014b8079f5ad1c701">d_ptr</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Utility API intended to demonstrate and facilitate access to DRM protected content. </p>
<p>The API has two private implementations, one Symbian specific - using the Content Access Framework (CAF) API - and an empty one which enables the API to be used (more like compiled) in the simulator </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a53dc1c86f77c9f37b8f7f2a1305fd682"></a><!-- doxytag: member="DRMFile::DRMFile" ref="a53dc1c86f77c9f37b8f7f2a1305fd682" args="(QObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DRMFile::DRMFile </td>
          <td>(</td>
          <td class="paramtype">QObject *&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code>0</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>parent</em>&nbsp;</td><td>Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.</td></tr>
  </table>
  </dd>
</dl>
<p>For the applicable distribution terms see the license.txt -file, included in the distribution. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="af1007998fe521bb33ce458f56aff0c27"></a><!-- doxytag: member="DRMFile::isDRMError" ref="af1007998fe521bb33ce458f56aff0c27" args="(int error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool DRMFile::isDRMError </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>error</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns true if the error code returned by the *open* method is a DRM specific error. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>error</em>&nbsp;</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a86497f25a0b6a500a4188bbfc56d566a"></a><!-- doxytag: member="DRMFile::open" ref="a86497f25a0b6a500a4188bbfc56d566a" args="(const QString &amp;name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int DRMFile::open </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read only open method for the specified file. </p>
<p>const QString &amp; name - fully cualified file name and path.</p>
<p>Will return a negative error code if the file opening fails. The error code should be checked with *isDRMError* in order to understand</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9787a72211feb206203384e835610e03"></a><!-- doxytag: member="DRMFile::read" ref="a9787a72211feb206203384e835610e03" args="(uchar *&amp;data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int DRMFile::read </td>
          <td>(</td>
          <td class="paramtype">uchar *&amp;&nbsp;</td>
          <td class="paramname"> <em>data</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Allocates memory buffer and reads the whole file content into that. Allocated buffer is returned to client via reference pointer 'data' parameter. Client is responcible for allocated memory release. </p>
<p>Will return a negative error code or the read data length.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a4741a5b903d47f2014b8079f5ad1c701"></a><!-- doxytag: member="DRMFile::d_ptr" ref="a4741a5b903d47f2014b8079f5ad1c701" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_d_r_m_file_private.html">DRMFilePrivate</a>* const <a class="el" href="class_d_r_m_file.html#a4741a5b903d47f2014b8079f5ad1c701">DRMFile::d_ptr</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Private implementation of the API </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="drmfile_8h_source.html">drmfile.h</a></li>
<li>drmfile.cpp</li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Thu Apr 26 2012 12:42:07 for QIap by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
